<?php
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_system')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `appid` varchar(100) NOT NULL COMMENT 'appid',
  `appsecret` varchar(200) NOT NULL COMMENT 'appsecret',
  `uniacid` varchar(50) NOT NULL COMMENT '所属模块',
  `appkey` varchar(50) NOT NULL COMMENT '短信appkey',
  `tpl_id` varchar(20) NOT NULL COMMENT '短信模板id',
  `logo` varchar(255) NOT NULL COMMENT 'logo',
  `mac_id` varchar(20) NOT NULL COMMENT '商户号',
  `apikey` varchar(100) NOT NULL COMMENT '商户密钥',
  `apiclient_cert` text NOT NULL COMMENT 'apiclient_cert',
  `apiclient_key` text NOT NULL COMMENT 'apiclient_key'
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_assistant')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `sort` int(11) NOT NULL,
  `number` varchar(11) NOT NULL COMMENT '工号',
  `assistant` varchar(10) NOT NULL COMMENT '职务',
  `name` varchar(10) NOT NULL,
  `time` datetime NOT NULL,
  `uniacid` int(11) NOT NULL,
  `store_id` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_banner')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `title` varchar(30) NOT NULL COMMENT '标题',
  `img` varchar(100) NOT NULL COMMENT '图片',
  `link` varchar(255) NOT NULL COMMENT '链接',
  `sort` tinyint(1) unsigned NOT NULL COMMENT '排序',
  `time` datetime NOT NULL COMMENT '时间',
  `uniacid` varchar(30) NOT NULL COMMENT '模块',
  `state` tinyint(1) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_cusmember')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `sort` int(11) NOT NULL,
  `number` varchar(11) NOT NULL COMMENT '编号',
  `time` datetime NOT NULL,
  `name` varchar(10) NOT NULL,
  `phone` varchar(11) NOT NULL,
  `money` varchar(11) NOT NULL,
  `fee` varchar(11) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `store_id` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_menu')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `title` varchar(10) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `link` varchar(100) NOT NULL,
  `state` tinyint(1) NOT NULL,
  `sort` int(11) NOT NULL,
  `img` varchar(255) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_moneyinfo')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `m_id` int(11) NOT NULL,
  `money` varchar(11) NOT NULL,
  `time` datetime NOT NULL,
  `uniacid` int(11) NOT NULL,
  `ass_id` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_moneyinfox')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `m_id` int(11) NOT NULL,
  `money` varchar(11) NOT NULL,
  `time` datetime NOT NULL,
  `uniacid` int(11) NOT NULL,
  `ass_id` int(11) NOT NULL,
  `projecttype_id` int(11) NOT NULL,
  `project_id` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_project')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `sort` int(11) NOT NULL,
  `projecttype_id` int(11) NOT NULL,
  `project` varchar(20) NOT NULL,
  `money` varchar(11) NOT NULL,
  `state` tinyint(1) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `store_id` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_projecttype')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `sort` int(11) NOT NULL,
  `title` varchar(20) NOT NULL,
  `state` tinyint(1) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `store_id` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_store')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `sort` int(11) NOT NULL,
  `storetype_id` int(11) NOT NULL COMMENT '门店类型id',
  `img` varchar(255) NOT NULL,
  `store` varchar(20) NOT NULL COMMENT '门店名',
  `name` varchar(10) NOT NULL,
  `phone` varchar(11) NOT NULL,
  `area` varchar(32) NOT NULL,
  `latlng` varchar(32) NOT NULL,
  `time` datetime NOT NULL,
  `admin` varchar(32) NOT NULL,
  `password` varchar(32) NOT NULL,
  `imgs` varchar(1200) NOT NULL,
  `detail` text NOT NULL,
  `uniacid` int(11) NOT NULL,
  `state` tinyint(4) NOT NULL,
  `rule` text NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_storetype')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `sort` int(11) NOT NULL,
  `title` varchar(20) NOT NULL,
  `state` tinyint(1) NOT NULL,
  `uniacid` int(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);
pdo_query("CREATE TABLE IF NOT EXISTS".tablename('zh_yjm_user')."(
  `id` int(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `openid` varchar(100) NOT NULL,
  `time` datetime NOT NULL,
  `avatar` varchar(255) NOT NULL,
  `uniacid` int(11) NOT NULL,
  `nickname` varchar(12) NOT NULL,
  `phone` varchar(11) NOT NULL
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;"
);

?>